package com.ludashi.weather;

import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.view.MotionEvent;

import com.ludashi.framework.Framework;
import com.ludashi.framework.utils.log.LogUtil;

/**
 * @author : xfhy
 * Create time : 2021/2/25 13:44
 * Description :
 */
public class App extends Application {

    public static Application sContext;

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        sContext = this;

        Framework.newInitializer()
                .applicationInstance(this)
                .versionCode(BuildConfig.VERSION_CODE)
                .versionName(BuildConfig.VERSION_NAME)
                .appName(getString(R.string.app_name))
                .pkgName(BuildConfig.APPLICATION_ID)
                .channel("ruirui")
                .logEnable(true)
                .logTag("battery")
                .logLevel(BuildConfig.DEBUG ? LogUtil.LEVEL.DEBUG : LogUtil.LEVEL.ERROR)
                .log2Console(true)
                .log2File(true)
                .frameworkService(new Framework.FrameworkService() {
                    @Override
                    public boolean checkPrivacy(Activity activity) {
                        return true;
                    }

                    @Override
                    public void onPageStart(String s) {

                    }

                    @Override
                    public void onPageEnd(String s) {

                    }

                    @Override
                    public void dispatchTouchEvent(MotionEvent motionEvent) {
                    }
                })
                .initialize();
    }
}

